Skip to content

Conversation

@ReenigneArcher
Copy link
Member

@ReenigneArcher ReenigneArcher commented Aug 23, 2025

Description

Introduced a ShutdownSignal utility for coordinated shutdown across threads. The web server and tray now support graceful shutdown, with the main function orchestrating thread lifecycles and timeouts. Added dependencies on ctrlc and tokio to support async shutdown handling.

Screenshot

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

@codecov
Copy link

codecov bot commented Aug 23, 2025

Codecov Report

❌ Patch coverage is 86.98630% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.05%. Comparing base (97916b4) to head (dda772e).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
crates/server/src/tray.rs 20.00% 12 Missing ⚠️
crates/server/src/web/mod.rs 68.75% 5 Missing ⚠️
crates/server/src/signal_handler.rs 98.26% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #26      +/-   ##
==========================================
+ Coverage   65.77%   72.05%   +6.28%     
==========================================
  Files          14       15       +1     
  Lines         409      551     +142     
==========================================
+ Hits          269      397     +128     
- Misses        140      154      +14     
Flag Coverage Δ
aarch64-apple-darwin 72.44% <86.98%> (+6.18%) ⬆️
aarch64-unknown-linux-gnu 72.05% <86.98%> (+6.28%) ⬆️
x86_64-apple-darwin 72.44% <86.98%> (+6.18%) ⬆️
x86_64-pc-windows-msvc 72.05% <86.98%> (+6.28%) ⬆️
x86_64-unknown-linux-gnu 72.05% <86.98%> (+6.28%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
crates/server/src/signal_handler.rs 98.26% <98.26%> (ø)
crates/server/src/web/mod.rs 81.66% <68.75%> (-4.70%) ⬇️
crates/server/src/tray.rs 50.00% <20.00%> (-3.34%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ReenigneArcher ReenigneArcher force-pushed the fix/properly-terminate-threads branch 13 times, most recently from b48756b to b1ac6e0 Compare August 29, 2025 00:02
@sonarqubecloud
Copy link

Introduces a new signal_handler module providing ShutdownSignal and ShutdownCoordinator for managing graceful shutdown across threads. Refactors main entry point, tray, and web modules to support coordinated shutdown using these primitives. Adds async and sync thread registration, monitoring, and timeout-based forced exit. Includes comprehensive unit and integration tests for shutdown coordination and signal handling.
Replaces the FORCE_EXIT_DISABLED static and related methods with a configurable exit function in ShutdownCoordinator. This enables tests to inject a no-op or custom exit handler, improving testability and removing Windows-specific test logic. Updates all relevant tests to use the new constructor with a mock exit function.
@ReenigneArcher ReenigneArcher force-pushed the fix/properly-terminate-threads branch from f39dc99 to dda772e Compare November 1, 2025 02:19
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 1, 2025

@ReenigneArcher ReenigneArcher marked this pull request as ready for review November 1, 2025 13:56
@ReenigneArcher ReenigneArcher merged commit 9a63acb into master Nov 1, 2025
19 checks passed
@ReenigneArcher ReenigneArcher deleted the fix/properly-terminate-threads branch November 1, 2025 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants